package tt.com.common.util;

public class PageUtil<T> {
    //总页数
    private Integer totalPage;
    //总条数
    private Integer totalSize;
    //当前页
    private Integer pageIndex = 1;
    //每页条数
    private Integer pageSize = 10;
    //结果集
    private T data;

    public Integer getTotalPage() {
        return totalPage;
    }

    public void setTotalPage(Integer totalPage) {
        this.totalPage = totalPage;
    }

    public Integer getTotalSize() {
        return totalSize;
    }

    public void setTotalSize(Integer totalSize) {
        this.totalSize = totalSize;
        this.totalPage = totalSize % pageSize == 0 ? totalSize / pageSize:totalSize / pageSize+1;
    }

    public Integer getPageIndex() {
        return pageIndex;
    }

    public void setPageIndex(Integer pageIndex) {
        this.pageIndex = pageIndex;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }
}
